<?php include __DIR__ . "/../../php/db.php"; ?>

<!DOCTYPE html>
<head>
	<title>Language</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css">
	<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
	<link href="css/bootstrap.min.resume.css" rel="stylesheet" type="text/css">
	<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
	<link href="css/resumestyle.css" rel="stylesheet" type="text/css">	
<?php

$login = $_SESSION['login'];

$userid = mysql_query("SELECT * FROM `flss`.`accounts` WHERE `user` = '$login'") or die(mysql_error());
while($rowshow = mysql_fetch_array($userid))
{
	$getid = $rowshow['account_id'];
}

if(isset($_POST['save']))
{
	$ewriting = $_POST['ewriting'];
	$espeaking = $_POST['espeaking'];
	$awriting = $_POST['awriting'];
	$aspeaking = $_POST['aspeaking'];
	$check = mysql_num_rows("SELECT * FROM a_language WHERE applicant_id = '$getid'");
	if($check > 0)
	{
	mysql_query("UPDATE `a_language` SET `engSpeaking`='$espeaking',`engWriting`='$ewriting',`arabSpeaking`='$aspeaking',`arabWriting`='$awriting' WHERE applicant_id = '$getid'");
	}
	else
	{
		mysql_query("INSERT INTO `a_language`(`applicant_id`, `engSpeaking`, `engWriting`, `arabSpeaking`, `arabWriting`) 
		VALUES ('$getid','$espeaking','$ewriting','$aspeaking','$awriting')");
	}
}


?>


</head>
<body class="templatemo-bg-gray">
	<div class="container" style="overflow-x:hidden;">
		<div class="col-md-12">	
			<h1 class="text-center margin-bottom-15">Language</h1>		
			<form class="form-horizontal templatemo-contact-form-2 templatemo-container"  method="post">
				<div class="row">
					<div class="col-md-6" style="width: 365px;">
						<div class="col-md-12 form-group">				         				         
						<label class="control-label">English Skills</label>
				    	</div>
				      </div>
				     </div>
				<div class="row">
					<div class="col-md-6" style="width: 365px;">
						<div class="col-md-12 form-group">				         				         
					         <div class="templatemo-inline-group">
					         	<div class="col-sm-12 templatemo-select-container">
								  <select name="espeaking" id="text4" style="width: 352px; height: 32px; padding-left:20px;">
  									<option selected disabled>Speaking Proficiency</option>
 									 <option value="1">1</option>
  									<option value="2">2</option>
  									<option value="3">3</option>
  									<option value="4">4</option>
									<option value="5">5</option>
 								 </select>
					         	</div>
							</div>
				    	</div>
				      </div>
					<div class="col-md-6">
						<div class="col-md-12 form-group">				         				         
					         <div class="templatemo-inline-group">
					         	<div class="col-sm-12 templatemo-select-container">
								  <select name="ewriting" id="text4" style="width: 352px; height: 32px; padding-left:20px;">
  									<option selected disabled>Writing Proficiency</option>
 									 <option value="1">1</option>
  									<option value="2">2</option>
  									<option value="3">3</option>
  									<option value="4">4</option>
									<option value="5">5</option>
 								 </select>
					         	</div>
							</div>
				    	</div>
				      </div>
				     </div>
				<div class="row">
					<div class="col-md-6" style="width: 365px;">
						<div class="col-md-12 form-group">				         				         
						<label class="control-label">Arabic Skills</label>
				    	</div>
				      </div>
				     </div>
				<div class="row">
					<div class="col-md-6" style="width: 365px;">
						<div class="col-md-12 form-group">				         				         
					         <div class="templatemo-inline-group">
					         	<div class="col-sm-12 templatemo-select-container">
								  <select name="aspeaking" id="text4" style="width: 352px; height: 32px; padding-left:20px;">
  									<option selected disabled>Speaking Proficiency</option>
 									 <option value="1">1</option>
  									<option value="2">2</option>
  									<option value="3">3</option>
  									<option value="4">4</option>
									<option value="5">5</option>
 								 </select>
					         	</div>
							</div>
				    	</div>
				      </div>
					<div class="col-md-6">
						<div class="col-md-12 form-group">				         				         
					         <div class="templatemo-inline-group">
					         	<div class="col-sm-12 templatemo-select-container">
								  <select name="awriting" id="text4" style="width: 352px; height: 32px; padding-left:20px;">
  									<option selected disabled>Writing Proficiency</option>
 									 <option value="1">1</option>
  									<option value="2">2</option>
  									<option value="3">3</option>
  									<option value="4">4</option>
									<option value="5">5</option>
 								 </select>
					         	</div>
							</div>
				    	</div>
				      </div>
				     </div>
		        <div class="form-group">
		          <div class="col-md-12">
		            <input type="submit" value="SAVE" name="save" class="btn btn-warning pull-right">		            
		          </div>
		        </div>		    	
		      </form>	
 
              
		</div>
	</div>
</body>
</html>